home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Softdisk Supreme
/
Softdisk Supreme.iso
/
pc
/
DSK Files
/
0-49
/
SD015b.dsk
/
DISK VERIFY.bas
< prev
next >
Wrap
BASIC Source File
|
2003-06-12
|
3KB
|
65 lines
5 REM CALL APPLE JUNE 82
6 TEXT : HOME
10 BX = 100: DIM BT(BX),BS(BX),MASK(7)
20 CALL -936: PRINT " DISK VERIFY"
25 GOSUB 2000: CALL 800:IOB = PEEK(1): IF IOB >127 THEN IOB = IOB -256
30 IOB = 256 *IOB + PEEK(0): POKE IOB +12,1: REM "READ"
35 POKE IOB +3,0: POKE IOB +8,0: POKE IOB +9,2
36 DRIVE = 3 - PEEK(IOB +2): REM USE EITHER PEEK(IOB+2) OR 3-PEEK(IOB+2)
40 PRINT : PRINT "PUT DISK IN SLOT "; PEEK(IOB +1)/16;", DRIVE ";DRIVE
42 PRINT : PRINT "AND PRESS <RETURN> ";: INPUT "";Y$
45 POKE IOB +2,DRIVE
50 REM
55 SX = 15:MEM = PEEK(978): IF MEM >127 THEN MEM = MEM -256
60 L1 = 256 *(MEM +34) +214:L2 = 256 *(MEM +9) +179
70 IF PEEK(L2) = 38 THEN SX = 12: REM SEE CALL APPLE-MAY 1981-P 53
80 IF PEEK(L2) THEN 100
90 IF PEEK(L1) = 240 OR PEEK(L1) = 96 THEN SX = 12
100 REM
110 BI = 0: CALL -936: PRINT "READING DISK....": PRINT
120 PRINT "VOL TRACK SECTOR RESULT": PRINT : POKE 34,4
130 FOR TRACK = 0 TO 34: FOR SECT = 0 TO SX
140 GOSUB 1000: PRINT VOL;" ";TRACK,SECT,RESULT
150 IF RESULT = 0 THEN 180
160 BI = BI +1: IF BI >BX THEN 650
170 BT(BI) = TRACK:BS(BI) = SECT
180 NEXT SECT: NEXT TRACK
200 REM
210 TEXT : IF BI = 0 THEN 610: REM QUIT NOW IF NO BAD SECTORS
230 PRINT "--BAD SECTORS--":TRACK = -1: FOR I = 1 TO BI
240 IF TRACK = BT(I) THEN 260
250 PRINT : PRINT "TRACK ";BT(I);" SECTOR";:TRACK = BT(I)
260 PRINT " ";BS(I);: NEXT I
300 REM
310 TEXT : PRINT : PRINT "MARK BAD SECTORS (Y/N)? ";: INPUT Y$
320 IF ASC(Y$) = ASC("N") THEN 640
330 IF ASC(Y$) - ASC("Y") THEN 300
340 TRACK = 17:SECT = 0: GOSUB 1000: REM READ VTOC
350 IF RESULT >0 THEN 660
360 VT = PEEK(IOB +9): IF VT >127 THEN VT = VT -256
370 VT = 256 *VT + PEEK(IOB +8): IF PEEK(VT +53) -SX -1 THEN 660
380 J = 256: FOR I = 0 TO 7:J = J/2:MASK(I) = 255 -J: NEXT I
390 FOR I = 1 TO BI:J = SX -BS(I):BM = VT +56 +4 *BT(I) +J/8: IF J >7 THEN J = J -8
400 POKE 0, PEEK(BM): POKE 1,MASK(J): CALL 768 +48: POKE BM, PEEK(0)
410 NEXT I: POKE IOB +12,2: GOSUB 1000
420 IF RESULT = 0 THEN 640
430 IF RESULT = 16 THEN 620
440 GOTO 630
600 REM
610 PRINT "ALL SECTORS READABLE": END
620 PRINT "*** ERROR *** DISK IS WRITE-PROTECTED": END
630 PRINT "*** ERROR *** UNABLE TO WRITE": END
640 PRINT "DONE": END
650 PRINT "TOO MANY BAD SECTORS!": END
660 PRINT : PRINT "*** ERROR *** CAN'T READ THE VTOC": END
1000 REM
1010 POKE IOB +4,TRACK
1020 POKE IOB +5,SECT
1030 CALL 768
1040 RESULT = PEEK(IOB +13)
1050 VOL = PEEK(IOB +14)
1060 RETURN
2000 REM
2010 HEX$ = "300:20 20 03 20 D9 03 B0 06 A9 00 A0 0D 91 00 60 N 320:20 E3 03 84 00 85 01 60 N 330:A5 01 25 00 85 00 60 N D9C6G"
2020 FOR I = 1 TO LEN(HEX$): POKE 511 +I,128 + ASC( MID$ (HEX$,I,1)): NEXT : POKE 72,0: CALL -144
2030 RETURN